import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);

import Home from '../pages/home.vue'
import Menu from '../pages/menu.vue'
import Detail from '../pages/detail.vue'
import Fill from '../pages/fill.vue'
import Myhash from '../pages/myhash.vue'
import List from '../pages/list.vue'
import Res from '../pages/res.vue'

let routes = [
  { path: '/home', component: Home },
  { path: '/menu/:keyword', component: Menu ,props:true},
  { path: '/detail/:id', component: Detail,props:true },
  { path: '/fill', component: Fill },
  { path:'/res',component:Res},
  { path:'/myhash',component:Myhash},
  { path:'/list',component:List},
  { path: '/', redirect: '/home' },
  { path: '*', component: Error },
];

let router = new VueRouter({
  routes,
  mode: 'hash'
  // mode: 'history'
});

export default router;